<?php if($countAlbums) : ?>
	<div class="u_cat">
		<div class="u_cat_head_strip"></div>
		<div class="u_cat_head">
			<a href="<?php echo Yii::app()->createUrl('albums/index', array('profile'=>$_GET['id']));?>">
				<em>Фотоальбомы</em><span><?php echo CHtml::encode($countAlbums); ?></span>
			</a>
		</div>
		<div class="u_cat_media albums">
			<?php foreach ($albums as $key => $album){ ?>
				<?php $class = (!$key) ? 'u_media' : 'u_media hidden'; ?>
				<a href="<?php echo Yii::app()->createUrl('albums/view',array('id' => $album->id, 'profile'=>Yii::app()->request->getParam('id')));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>">
					<?php echo  ($album->main_photo!=NULL) ? 
							$this->material_image($album->id, $album->main_photo->name, '180', 'photos/'.$album->user->id.'/'.$album->id): 
								$this->material_image(0, 'noimage.gif', '180', ''); ?>
				</a>
			<?php } ?>	
			<div class="u_media_nav">
				<div class="u_media_nav_prev"></div>
				<div class="u_media_nav_next"></div>
				<?php foreach ($albums as $key => $album){ ?>
					<?php $class = (!$key) ? 'u_media_nav_name' : 'u_media_nav_name hidden'; ?>
					<a href="<?php echo Yii::app()->createUrl('albums/view',array('id' => $album->id, 'profile'=>Yii::app()->request->getParam('id')));?>" class="<?php echo $class; ?>" id="audio_<?php echo ($key+1);?>_"><?php echo CHtml::encode($album->name); ?></a>
				<?php } ?>
			</div>
		</div>
	</div>
<?php elseif (Yii::app()->request->getParam('id') == Yii::app()->user->id) : ?>
	<div class="u_cat">
		<div class="u_cat_head_strip"></div>
		<div class="u_cat_head">
			<a href="<?php echo Yii::app()->createUrl('albums/index', array('profile'=>$_GET['id']));?>">
				<em>Фотоальбомы</em><span><?php echo CHtml::encode($countAlbums); ?></span>
			</a>
		</div>
		<div class="u_cont_list">
			<div class="u_cont">
				<div class="u_cont_r_empty ajaxLinks">
					У вас нету фотоальбомов.
					<p><a href="<?php echo Yii::app()->createUrl('albums/create', array('profile'=>Yii::app()->request->getParam('id')));?>" class="u_cont_h2_discussion ajaxLink">
						Добавить 
					</a></p>
				</div>
			</div>
		</div>
	</div>
<?php endif; ?>